***********************************************************
* Replication archive for
* Bechtel, Michael M./Scheve, Kenneth F. (2013) 
* "Mass support for global climate agreements* depends on institutional design"
* Proceedings of the National Academy of Sciences of 
* the United States of America
* Available at: http://www.pnas.org/content/early/2013/07/24/1306374110.full.pdf+html
***********************************************************
version 12
set more off

capture log close 
log using "Replication Results_Bechtel Scheve_PNAS.smcl", replace

use bechtel_scheve_pnas.dta, clear
xtset ID

* 1. Replicate results reported in Figure 2 (Pooled Data)
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig 2 Results.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig 2 Results.xls", ctitle("All countries") excel bdec(3) stats(coef se) append


* 2. Replicate results reported in Figure 3 (Results by Country)
* 1=France, 2=Germany, 3=United Kingdom, 4=United States
reg choice_cj [pweight=weight] if country==1, vce(cluster ID)
outreg2 using "Fig 3 Results.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

* a. France
reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight] if country==1, vce(cluster ID)
outreg2 using "Fig 3 Results.xls", ctitle(France) excel bdec(3) stats(coef se) append

* b. Germany
reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight] if country==2, vce(cluster ID)
outreg2 using "Fig 3 Results.xls", ctitle(Germany) excel bdec(3) stats(coef se) append

* c. United Kingdom
reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight] if country==3, vce(cluster ID)
outreg2 using "Fig 3 Results.xls", ctitle(UK) excel bdec(3) stats(coef se) append

* d. United States
reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight] if country==4, vce(cluster ID)
outreg2 using "Fig 3 Results.xls", ctitle(US) excel bdec(3) stats(coef se) append


* 3. Replicate results reported in Figure 4 (Environmentalism and Reciprocity)
reg choice_cj [pweight=weight] , vce(cluster ID)
outreg2 using "Fig 4 Results.xls" , ctitle(Empty) excel bdec(3) stats(coef se) replace

* a. Environmentalism: Low
reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if support_iec_high_group==0 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig 4 Results.xls" , ctitle(Environmentalism: Low) excel bdec(3) stats(coef se) append

* b. Environmentalism: High
reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if support_iec_high_group==1 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig 4 Results.xls" , ctitle(Environmentalism: High) excel bdec(3) stats(coef se) append

* c. Reciprocity: Low
reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if recip_s_high_group==0 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig 4 Results.xls" , ctitle(Reciprocity: Low) excel bdec(3) stats(coef se) append

* d. Reciprocity: High
reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if recip_s_high_group==1 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig 4 Results.xls" , ctitle(Reciprocity: High) excel bdec(3) stats(coef se) append

* 4. Replicate results in SI Appendix
* Fig. S1 Educational Attainment
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S1.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if educ_high==1 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig S1.xls", ctitle("Education: High") excel bdec(3) stats(coef se) append

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if educ_high==0 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig S1.xls", ctitle("Education: Low") excel bdec(3) stats(coef se) append

* Fig. S2 Level of Attention
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S2.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if attentioncheck_pass==1 [pweight=weight], vce(cluster ID)
outreg2 using "Fig S2.xls", ctitle(Attention: High) excel bdec(3) stats(coef se) append

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if attentioncheck_pass==0 [pweight=weight], vce(cluster ID)
outreg2 using "Fig S2.xls", ctitle(Attention: Low) excel bdec(3) stats(coef se) append

* Fig. S3 Level of Political Knowledge--Secretary of State
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S3.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if gknow1==1 [pweight=weight], vce(cluster ID)
outreg2 using "Fig S3.xls", ctitle(Knowledge: High (secretary of state)) excel bdec(3) stats(coef se) append

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if gknow1==0 [pweight=weight], vce(cluster ID)
outreg2 using "Fig S3.xls", ctitle(Knowledge: Low (secretary of state)) excel bdec(3) stats(coef se) append

* Fig. S4 Level of Political Knowledge--Term Length
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S4.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if gknow3==1 [pweight=weight], vce(cluster ID)
outreg2 using "Fig S4.xls", ctitle(Knowledge: High (term length)) excel bdec(3) stats(coef se) append

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if gknow3==0 [pweight=weight], vce(cluster ID)
outreg2 using "Fig S4.xls", ctitle(Knowledge: Low (term length)) excel bdec(3) stats(coef se) append

* Fig. S5 Agreement Rating Pooled Data
reg rating_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S5.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg rating_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight] , vce(cluster ID) 
outreg2 using "Fig S5.xls", ctitle(Dependent Variable: Agreement Rating) excel bdec(3) stats(coef se) append

* Fig. S6 Consistent Choices
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S6.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if incon==0 [pweight=weight], vce(cluster ID)
outreg2 using "Fig S6.xls", ctitle(Consistent choices) excel bdec(3) stats(coef se) append

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj if incon==1 [pweight=weight], vce(cluster ID)
outreg2 using "Fig S6.xls", ctitle(Inconsistent choices) excel bdec(3) stats(coef se) append

* Fig. S7 Socio-economic controls
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S7.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj income age female educ_high[pweight=weight], vce(cluster ID)
outreg2 using "Fig S7.xls", ctitle(With Controls) excel bdec(3) stats(coef se) append

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S7.xls", ctitle(Without Controls) excel bdec(3) stats(coef se) append

* Fig. S8 Probit Estimates Pooled Data
probit choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S8.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

probit choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S8.xls", ctitle(Probit estimates) excel bdec(3) stats(coef se) append

* Fig. S9 Results Using only First Conjoint Comparison
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S9.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj [pweight=weight] if conjoint==1, vce(cluster ID)
outreg2 using "Fig S9.xls", ctitle(First conjoint only) excel bdec(3) stats(coef se) append

* Fig. S10 Willingness to pay
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S10.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj  if ewill_pay_high==0 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig S10.xls", ctitle(Willingness to Pay: Low) excel bdec(3) stats(coef se) append

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj  if ewill_pay_high==1 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig S10.xls", ctitle(Willingness to Pay: High) excel bdec(3) stats(coef se) append

* Fig. S11 Importance of reductions
* Reductions important: Low
reg choice_cj [pweight=weight], vce(cluster ID)
outreg2 using "Fig S11.xls", ctitle(Empty) excel bdec(3) stats(coef se) replace

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj  if reductions_important==0 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig S11.xls", ctitle(Reductions Important: Low) excel bdec(3) stats(coef se) append

reg choice_cj i.cost_cj i.distrib_cj i.ctries_cj i.emissions_cj i.sanctions_cj i.monitoring_cj  if reductions_important==1 [pweight=weight] , vce(cluster ID)
outreg2 using "Fig S11.xls", ctitle(Reductions Important: High) excel bdec(3) stats(coef se) append

* Table S1: See below

* Table S2: Balance tests
label var ctries_cj "Participation: Countries"
label var cost_cj "Costs per Household"
label var emissions_cj "Participation: Emissions"
label var distrib_cj "Costs: Distribution"
label var sanctions_cj "Enforcement: Sanctions"
label var monitoring_cj "Enforcement: Monitoring" 
label var income "HH Income"
label var educ_high "Education"

label define costs_gen_lab 1 "0.5% GDP" 2 "1% GDP" 3 "1.5% GDP" 4 "2% GDP" 5 "2.5% GDP"
label values cost_cj costs_gen_lab

label define sanct_gen_lab 1 "None" 2 "0.5% of 2% GDP" 3 "1% of 2% GDP" 4 "1.5% of 2% GDP"
label values sanctions_cj sanct_gen_lab

local X1="income age female educ_high" 
 
outreg2 using "Table S2.xls", ctitle("")excel bdec(3) stats(coef se) replace

set more off
foreach var of varlist cost_cj distrib_cj ctries_cj emissions_cj sanctions_cj monitoring_cj {
mlogit `var' `X1'
outreg2 using "Table S2.xls", ctitle(Dependent Var: `var') excel bdec(3) stats(coef se) append
}

* Table S3: Levels of support by country 
* a. Convert 1 to 10 rating scale into 0 to 100 rating scale
* New rating on [0,100]=constant+rating*slope
* constant:	-(10*(100/9))-100)
* slope:		(100/9)
local const=-(10*(100/9)-100)
local slope=100/9
display "constant=`const' and slope=`slope'"

gen nrat=.
replace nrat=`const'+rating_cj*`slope' if rating_cj!=.
label var nrat "Agreement Rating (0-100)"

* b. Prepare dummy variables for agreement features
tab cost_cj, gen(cost)
rename cost1 cost_05
rename cost2 cost_10
rename cost3 cost_15
rename cost4 cost_20
rename cost5 cost_25

tab distrib_cj, gen(distrib)
rename distrib1 distrib_richonly
rename distrib2 distrib_propcurrent
rename distrib3 distrib_prophist
rename distrib4 distrib_richmore

tab ctries_cj, gen(ctries)
rename ctries1 ctries_20
rename ctries2 ctries_80 
rename ctries3 ctries_160

tab emissions_cj, gen(emiss)
rename emiss1 emiss_40
rename emiss2 emiss_60 
rename emiss3 emiss_80

tab sanctions_cj, gen(sanct)
rename sanct1 sanct_none
rename sanct2 sanct_5
rename sanct3 sanct_15
rename sanct4 sanct_20

tab monitoring_cj, gen(monit)
rename monit1 monit_yourgov
rename monit2 monit_indepcomm
rename monit3 monit_un
rename monit4 monit_greenpeace

* c. Loop over countries: 
forvalues x=1/4 {
display "Results for Country=`x', Note: 1=France, 2=Germany, 3=United Kingdom, 4=United States"

*	aa. Compute level of support new rating
su nrat if country==`x'

* 	bb. Estimate effects
qui reg nrat cost_10 cost_15 cost_20 cost_25 distrib_propcurrent distrib_prophist distrib_richmore ctries_80 ctries_160 emiss_60 emiss_80 sanct_5 sanct_15 sanct_20 monit_indepcomm monit_un monit_greenpeace [pweight=weight] if country==`x', vce(cluster ID) 

*	cc. Synthesize support for two different scenarios
		* A) Scenario 1: costs of 2\% of GDP; only rich countries pay; 60 countries participate; emissions 60\%; monitoring by the United Nations; no sanctions
		display "Support for Likely Agreement"
		lincom _cons + cost_20 + emiss_60 + monit_un

		* B) Scenario 2 (support maximizing): costs of 0.5\% of GDP; proportional to current emissions; 160 countries; 80\%; independent commission; low sanction
		display "Support for Most Popular Agreement"
		lincom _cons + emiss_60 + distrib_propcurrent + ctries_160 + emiss_80 + monit_indepcomm  + sanct_5

}

* Table S4 Interaction Results (Environmentalism vs. Left Ideolgy)
* a. Prepare interactions
* Prepare left ideology indicator
recode right (0=1) (1=0) (.=.), gen(left)
label var left "Ideology: Left vs. right"

foreach var in cost_05 cost_10 cost_15 cost_20 cost_25 distrib_richonly distrib_propcurrent distrib_prophist distrib_richmore ctries_20 ctries_80 ctries_160 emiss_40 emiss_60 emiss_80 sanct_none sanct_5 sanct_15 sanct_20 monit_yourgov monit_indepcomm monit_un monit_greenpeace {
gen `var'Xiec=`var'*support_iec_high_group
gen `var'Xleft=`var'*left
}

local costs="cost_10 cost_10Xiec cost_15 cost_15Xiec cost_20 cost_20Xiec cost_25 cost_25Xiec"
local distrib="distrib_propcurrent distrib_propcurrentXiec distrib_prophist distrib_prophistXiec distrib_richmore distrib_richmoreXiec"
local ctries="ctries_80 ctries_80Xiec ctries_160 ctries_160Xiec"
local emiss="emiss_60 emiss_60Xiec emiss_80 emiss_80Xiec"
local sanct="sanct_5 sanct_5Xiec sanct_15 sanct_15Xiec sanct_20 sanct_20Xiec"
local monit="monit_indepcomm monit_indepcommXiec monit_un monit_unXiec monit_greenpeace monit_greenpeaceXiec"

* Estimate models used for MFX plots
reg choice_cj [pweight=weight] , vce(cluster ID)
outreg2 using "Table S4_environmentalism.xls", excel bdec(3) stats(coef se) replace

* Interactions with environmentalism (Support for International Environmental Cooperation)
reg choice_cj `costs' `distrib' `ctries' `emiss' `sanct' `monit' support_iec_high_group [pweight=weight], vce(cluster ID)
outreg2 using "Table S4_environmentalism.xls", ctitle(Interactions with Environmentalism) excel bdec(3) stats(coef se) append

* Interactions with left ideology
local costs="cost_10 cost_10Xleft cost_15 cost_15Xleft cost_20 cost_20Xleft cost_25 cost_25Xleft"
local distrib="distrib_propcurrent distrib_propcurrentXleft distrib_prophist distrib_prophistXleft distrib_richmore distrib_richmoreXleft"
local ctries="ctries_80 ctries_80Xleft ctries_160 ctries_160Xleft"
local emiss="emiss_60 emiss_60Xleft emiss_80 emiss_80Xleft"
local sanct="sanct_5 sanct_5Xleft sanct_15 sanct_15Xleft sanct_20 sanct_20Xleft"
local monit="monit_indepcomm monit_indepcommXleft monit_un monit_unXleft monit_greenpeace monit_greenpeaceXleft"

reg choice_cj [pweight=weight] , vce(cluster ID)
outreg2 using "Table S4_leftideology.xls", excel bdec(3) stats(coef se) replace

reg choice_cj `costs' `distrib' `ctries' `emiss' `sanct' `monit' left [pweight=weight], vce(cluster ID)
outreg2 using "Table S4_leftideology.xls", ctitle(Interactions with Left Ideology) excel bdec(3) stats(coef se) append


* Table S1: Distribution of Socio-demographics
* Population demographics sources: see note for Table S1
bysort ID: gen aux=_n
keep if aux==1
* Distribution of sociodemgraphics
* a. France
svyset [pweight=weight]

* Age
gen agegr_fr=.
replace agegr_fr=1 if age>=18 & age<=39 
replace agegr_fr=2 if age>=40 & age<=54 
replace agegr_fr=3 if age>=55 & age<. 
label define agegr_fr 1 "Age: 18-39" 2 "Age: 40-54" 3 "Age: 55+"
label values agegr_fr agegr_fr

tab agegr_fr if country==1
svy: tab agegr_fr if country==1

* Gender
tab gender if country==1
svy: tab gender if country==1

* Education
tab educgr_fr if country==1
svy: tab educgr_fr if country==1

* b. Germany
* Age
gen agegr_ge=.
replace agegr_ge=1 if age>=18 & age<=34 
replace agegr_ge=2 if age>=35 & age<=54 
replace agegr_ge=3 if age>=55 & age<. 
label define agegr_ge 1 "Age: 18-34" 2 "Age: 35-54" 3 "Age: 55+"
label values agegr_ge agegr_ge

tab agegr_ge if country==2
svy: tab agegr_ge if country==2
* Gender
tab gender if country==2
svy: tab gender if country==2

* Education
tab educgr_ge if country==2
svy: tab educgr_ge if country==2

* c. United Kingdom
* Age
gen agegr_uk=.
replace agegr_uk=1 if age>=18 & age<=34 
replace agegr_uk=2 if age>=35 & age<=54 
replace agegr_uk=3 if age>=55 & age<. 
label values agegr_uk agegr_ge

tab agegr_uk if country==3
svy: tab agegr_uk if country==3
* Gender
tab gender if country==3
svy: tab gender if country==3

* Education
tab educgr_uk if country==3
svy: tab educgr_uk if country==3

* c. United States
* Age
gen agegr_us=.
replace agegr_us=1 if age>=18 & age<=34 
replace agegr_us=2 if age>=35 & age<=54 
replace agegr_us=3 if age>=55 & age<. 
label values agegr_us agegr_ge

tab agegr_us if country==4
svy: tab agegr_us if country==4

* Gender
tab gender if country==4
svy: tab gender if country==4

* Education
tab educgr_us if country==4
svy: tab educgr_us if country==4

capture log close
clear
exit

